﻿package mortal.game.view.guildWar
{
    import com.mui.containers.*;
    import com.mui.containers.globalVariable.*;
    import com.mui.controls.*;
    import com.mui.display.*;
    import mortal.common.global.*;
    import mortal.game.cache.guildWar.*;
    import mortal.game.resource.*;
    import mortal.game.scene3D.layer3D.utils.*;
    import mortal.game.utils.*;
    import mortal.game.view.common.*;

    public class GuildWarRankCellRenderer extends GCellRenderer
    {
        private var _selfBg:ScaleBitmap;
        private var _box:GBox;
        private var _tfRank:GTextFiled;
        private var _tfGuild:GTextFiled;
        private var _tfPlayerName:GTextFiled;
        private var _tfCareer:GTextFiled;
        private var _tfCombat:GTextFiled;
        private var _tfKill:GTextFiled;
        private var _tfAssists:GTextFiled;
        private var _tfBeKill:GTextFiled;
        private var _tfContribute:GTextFiled;
        private var _tfExploit:GTextFiled;
        private var _line:ScaleBitmap;

        public function GuildWarRankCellRenderer()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._selfBg = UIFactory.bg(0, -2, 785, 32, this, ImagesConst.selectFilter);
            this._selfBg.visible = false;
            this._box = UIFactory.getUICompoment(GBox);
            this._box.direction = GBoxDirection.HORIZONTAL;
            UIFactory.setObjAttri(this._box, 0, 4, -1, -1, this);
            this._tfRank = UIFactory.gTextField("", 0, 0, 60, 20, this._box, GlobalStyle.textFormatBai.center());
            this._tfGuild = UIFactory.gTextField("", 0, 0, 115, 20, this._box, GlobalStyle.textFormatBai.center());
            this._tfPlayerName = UIFactory.gTextField("", 0, 0, 160, 20, this._box, GlobalStyle.textFormatBai.center());
            this._tfCareer = UIFactory.gTextField("", 0, 0, 60, 20, this._box, GlobalStyle.textFormatBai.center());
            this._tfCombat = UIFactory.gTextField("", 0, 0, 80, 20, this._box, GlobalStyle.textFormatLv.center());
            this._tfKill = UIFactory.gTextField("", 0, 0, 60, 20, this._box, GlobalStyle.textFormatLv.center());
            this._tfAssists = UIFactory.gTextField("", 0, 0, 60, 20, this._box, GlobalStyle.textFormatLv.center());
            this._tfBeKill = UIFactory.gTextField("", 0, 0, 65, 20, this._box, GlobalStyle.textFormatLv.center());
            this._tfContribute = UIFactory.gTextField("", 0, 0, 65, 20, this._box, GlobalStyle.textFormatBai.center());
            this._tfExploit = UIFactory.gTextField("", 0, 0, 65, 20, this._box, GlobalStyle.textFormatBai.center());
            this._line = UIFactory.bg(0, 28, 780, 2, this, "SplitLine");
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._selfBg.dispose(param1);
            this._selfBg = null;
            this._box.dispose(param1);
            this._box = null;
            this._tfRank = null;
            this._tfGuild = null;
            this._tfPlayerName = null;
            this._tfCareer = null;
            this._tfCombat = null;
            this._tfKill = null;
            this._tfAssists = null;
            this._tfBeKill = null;
            this._tfContribute = null;
            this._tfExploit = null;
            this._line.dispose(param1);
            this._line = null;
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            var _loc_2:* = param1 as GuildWarRank;
            this._tfRank.text = _loc_2.rank.toString();
            this._tfGuild.text = _loc_2.score.guildName.toString();
            this._tfPlayerName.text = NameUtil.getProxyName(_loc_2.score.playerId, true) + _loc_2.score.playerName.toString();
            this._tfCareer.text = GameDefConfig.instance.getCarrer(_loc_2.score.career);
            this._tfCombat.text = _loc_2.score.combat.toString();
            this._tfKill.text = _loc_2.score.kill.toString();
            this._tfAssists.text = _loc_2.score.assist.toString();
            this._tfBeKill.text = _loc_2.score.killed.toString();
            this._tfContribute.text = _loc_2.score.contribute.toString();
            this._tfExploit.text = _loc_2.score.exploit.toString();
            this._box.resetPosition2();
            this._selfBg.visible = EntityUtil.isSelf(_loc_2.score.playerId);
            return;
        }// end function

    }
}
